<?
include_once('../conn.php');
include_once('../include/func.php');
require("../admin_check.php") ;
header("Content-type: text/html; charset=utf-8"); 

//print_r($_GET);
//echo urldecode(iconv("gb2312", "UTF-8",$_GET[value]));
//echo $_GET[ch_item];

function ch_item_value($iid,$where,$value){
	global $db; global $tablepre;
	$value=htmlspecialchars($value, ENT_QUOTES);
	$ch = $db->UPDATE("UPDATE `".tablepre."stock_item` SET `".$where."`='".$value."' WHERE `iid`='".$iid."'");  //更新数组UPDATE `we_stock_item` SET `quality1`='grg' WHERE (`iid`='77') LIMIT 1
	if($ch){
		return '修改成功('.$value.')';
		}else{
			return '修改失败('.$value.')';
			}
	}
	if(isset($_GET[ch_item])){
		
		if($_GET[a]=='quantity'){
			$itemid=explode(',',$_GET[ch_item]);
			echo ch_item_value($itemid[0],$_GET[a],$_GET[value]);
			count_item_quantity(1,$itemid[1]);
			}else{
				echo ch_item_value($_GET[ch_item],$_GET[a],$_GET[value]);
				}

	}
?>